\doxysection{Logger类 参考}
\hypertarget{class_logger}{}\label{class_logger}\index{Logger@{Logger}}


{\ttfamily \#include $<$Logger.\+h$>$}

\doxysubsubsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{class_logger_a68cafca721107a954d85043a553dd217}{\texorpdfstring{$\sim$}{\string~}\+Logger}} ()=default
\item 
virtual void \mbox{\hyperlink{class_logger_a3de1b6ed57224b98699fa1fb4d69537f}{async\+Log}} (std\+::string\+\_\+view content, \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}} level=\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}, \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}} out=\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}, std\+::string\+\_\+view path="{}./App\+Log/"{}, const std\+::source\+\_\+location \&location=std\+::source\+\_\+location\+::current())
\item 
virtual void \mbox{\hyperlink{class_logger_a67fac285fd603d742a2e0eea7783e9b6}{sync\+Log}} (std\+::string\+\_\+view content, \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}} level=\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}, \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}} out=\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}, std\+::string\+\_\+view path="{}./App\+Log/"{}, const std\+::source\+\_\+location \&location=std\+::source\+\_\+location\+::current())
\item 
void \mbox{\hyperlink{class_logger_adcdbfe0302dd53c9db3d355ddee8a3b6}{start\+Log\+Thread}} ()
\item 
void \mbox{\hyperlink{class_logger_aa223fb9d3d6becff1ee3ae8c40ec11f3}{stop\+Log\+Thread}} ()
\end{DoxyCompactItemize}
\doxysubsubsection*{静态 Public 成员函数}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{class_logger}{Logger}} \& \mbox{\hyperlink{class_logger_ad8c2e8259462504427739fbaf2e056bd}{get\+Intance}} ()
\end{DoxyCompactItemize}
\doxysubsubsection*{Private 成员函数}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_logger_ac45b6ef7069b222c094da3724d1aa8fb}{Logger}} ()=default
\item 
void \mbox{\hyperlink{class_logger_a10c246805aee7279977997e1ae6832ab}{set\+Is\+Running}} (bool is\+Running)
\item 
void \mbox{\hyperlink{class_logger_a69c0de1dd60ca195eb000a8fa94139a8}{thread\+Exec}} ()
\item 
void \mbox{\hyperlink{class_logger_a7d13896ef57933333ed113e6bef06b21}{set\+Write\+Behavior}} (\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}} out)
\item 
\mbox{\hyperlink{class_log}{Log}} \mbox{\hyperlink{class_logger_a6cf75422c01fb88b57f4b5f362f6d829}{create\+Log}} (std\+::string\+\_\+view content, \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}} level=\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}, \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}} out=\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}, std\+::string\+\_\+view path="{}./Log/"{}, const std\+::source\+\_\+location \&location=std\+::source\+\_\+location\+::current())
\end{DoxyCompactItemize}
\doxysubsubsection*{Private 属性}
\begin{DoxyCompactItemize}
\item 
bool \mbox{\hyperlink{class_logger_a710380268f6d4bb1bfa841e0d71b3868}{m\+Is\+Running}} \{false\}
\item 
std\+::unique\+\_\+ptr$<$ \mbox{\hyperlink{class_write}{Write}} $>$ \mbox{\hyperlink{class_logger_ac8ffdc12d6b2ded2029b8de314b2ba12}{write\+Behavior}}
\item 
std\+::mutex \mbox{\hyperlink{class_logger_a89fd90aeb0d8a6f67511e22b64d14eb6}{m\+Mutex}}
\item 
std\+::deque$<$ \mbox{\hyperlink{class_log}{Log}} $>$ \mbox{\hyperlink{class_logger_a4b3566ea069cfd43703b194ce9846d5e}{m\+Logs}}
\item 
std\+::thread \mbox{\hyperlink{class_logger_a9d7b008ee613498e7d2c6a320962555a}{thread}}
\end{DoxyCompactItemize}


\doxysubsection{详细描述}
\begin{DoxyAuthor}{作者}
liangxi 
\end{DoxyAuthor}
\begin{DoxySince}{自从}
2024/3/20 
\end{DoxySince}


\doxysubsection{构造及析构函数说明}
\Hypertarget{class_logger_a68cafca721107a954d85043a553dd217}\index{Logger@{Logger}!````~Logger@{\texorpdfstring{$\sim$}{\string~}Logger}}
\index{````~Logger@{\texorpdfstring{$\sim$}{\string~}Logger}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{\texorpdfstring{$\sim$}{\string~}Logger()}{\string~Logger()}}
{\footnotesize\ttfamily \label{class_logger_a68cafca721107a954d85043a553dd217} 
virtual Logger\+::\texorpdfstring{$\sim$}{\string~}\+Logger (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}, {\ttfamily [default]}}

\Hypertarget{class_logger_ac45b6ef7069b222c094da3724d1aa8fb}\index{Logger@{Logger}!Logger@{Logger}}
\index{Logger@{Logger}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{Logger()}{Logger()}}
{\footnotesize\ttfamily \label{class_logger_ac45b6ef7069b222c094da3724d1aa8fb} 
Logger\+::\+Logger (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [default]}}



\doxysubsection{成员函数说明}
\Hypertarget{class_logger_a3de1b6ed57224b98699fa1fb4d69537f}\index{Logger@{Logger}!asyncLog@{asyncLog}}
\index{asyncLog@{asyncLog}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{asyncLog()}{asyncLog()}}
{\footnotesize\ttfamily \label{class_logger_a3de1b6ed57224b98699fa1fb4d69537f} 
void Logger\+::async\+Log (\begin{DoxyParamCaption}\item[{std\+::string\+\_\+view}]{content}{, }\item[{\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}}}]{level}{ = {\ttfamily \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}}, }\item[{\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}}}]{out}{ = {\ttfamily \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}}, }\item[{std\+::string\+\_\+view}]{path}{ = {\ttfamily "{}./AppLog/"{}}, }\item[{const std\+::source\+\_\+location \&}]{location}{ = {\ttfamily std\+:\+:source\+\_\+location\+:\+:current()}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

异步打印日志 
\begin{DoxyParams}{参数}
{\em content} & 需要打印的内容 \\
\hline
{\em level} & 日志类型 \\
\hline
{\em out} & 输出方式 \\
\hline
{\em path} & 输出路径/在\+Console模式下可忽略 \\
\hline
{\em location} & 用于记录文件名和行号\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{作者}
liangxi 
\end{DoxyAuthor}
\begin{DoxySince}{自从}
2024/3/20 
\end{DoxySince}
\Hypertarget{class_logger_a6cf75422c01fb88b57f4b5f362f6d829}\index{Logger@{Logger}!createLog@{createLog}}
\index{createLog@{createLog}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{createLog()}{createLog()}}
{\footnotesize\ttfamily \label{class_logger_a6cf75422c01fb88b57f4b5f362f6d829} 
\mbox{\hyperlink{class_log}{Log}} Logger\+::create\+Log (\begin{DoxyParamCaption}\item[{std\+::string\+\_\+view}]{content}{, }\item[{\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}}}]{level}{ = {\ttfamily \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}}, }\item[{\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}}}]{out}{ = {\ttfamily \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}}, }\item[{std\+::string\+\_\+view}]{path}{ = {\ttfamily "{}./Log/"{}}, }\item[{const std\+::source\+\_\+location \&}]{location}{ = {\ttfamily std\+:\+:source\+\_\+location\+:\+:current()}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_ad8c2e8259462504427739fbaf2e056bd}\index{Logger@{Logger}!getIntance@{getIntance}}
\index{getIntance@{getIntance}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{getIntance()}{getIntance()}}
{\footnotesize\ttfamily \label{class_logger_ad8c2e8259462504427739fbaf2e056bd} 
static \mbox{\hyperlink{class_logger}{Logger}} \& Logger\+::get\+Intance (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

\Hypertarget{class_logger_a10c246805aee7279977997e1ae6832ab}\index{Logger@{Logger}!setIsRunning@{setIsRunning}}
\index{setIsRunning@{setIsRunning}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{setIsRunning()}{setIsRunning()}}
{\footnotesize\ttfamily \label{class_logger_a10c246805aee7279977997e1ae6832ab} 
void Logger\+::set\+Is\+Running (\begin{DoxyParamCaption}\item[{bool}]{is\+Running}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}

\Hypertarget{class_logger_a7d13896ef57933333ed113e6bef06b21}\index{Logger@{Logger}!setWriteBehavior@{setWriteBehavior}}
\index{setWriteBehavior@{setWriteBehavior}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{setWriteBehavior()}{setWriteBehavior()}}
{\footnotesize\ttfamily \label{class_logger_a7d13896ef57933333ed113e6bef06b21} 
void Logger\+::set\+Write\+Behavior (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}}}]{out}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_adcdbfe0302dd53c9db3d355ddee8a3b6}\index{Logger@{Logger}!startLogThread@{startLogThread}}
\index{startLogThread@{startLogThread}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{startLogThread()}{startLogThread()}}
{\footnotesize\ttfamily \label{class_logger_adcdbfe0302dd53c9db3d355ddee8a3b6} 
void Logger\+::start\+Log\+Thread (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

启动日志线程 在异步输出日志之前调用 \Hypertarget{class_logger_aa223fb9d3d6becff1ee3ae8c40ec11f3}\index{Logger@{Logger}!stopLogThread@{stopLogThread}}
\index{stopLogThread@{stopLogThread}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{stopLogThread()}{stopLogThread()}}
{\footnotesize\ttfamily \label{class_logger_aa223fb9d3d6becff1ee3ae8c40ec11f3} 
void Logger\+::stop\+Log\+Thread (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

停止日志线程 \Hypertarget{class_logger_a67fac285fd603d742a2e0eea7783e9b6}\index{Logger@{Logger}!syncLog@{syncLog}}
\index{syncLog@{syncLog}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{syncLog()}{syncLog()}}
{\footnotesize\ttfamily \label{class_logger_a67fac285fd603d742a2e0eea7783e9b6} 
void Logger\+::sync\+Log (\begin{DoxyParamCaption}\item[{std\+::string\+\_\+view}]{content}{, }\item[{\mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196e}{Log\+::\+Log\+Level}}}]{level}{ = {\ttfamily \mbox{\hyperlink{class_log_a3718f3e276c3d3e23b58a3b8236d196eaa603905470e2a5b8c13e96b579ef0dba}{Log\+::\+Log\+Level\+::\+Debug}}}, }\item[{\mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4}{Log\+::\+Output}}}]{out}{ = {\ttfamily \mbox{\hyperlink{class_log_ae9a5b0a1962f5076860bde2221f8e9e4abccaa4aa80831b76c11240a16447975f}{Log\+::\+Output\+::\+Console}}}, }\item[{std\+::string\+\_\+view}]{path}{ = {\ttfamily "{}./AppLog/"{}}, }\item[{const std\+::source\+\_\+location \&}]{location}{ = {\ttfamily std\+:\+:source\+\_\+location\+:\+:current()}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

同步打印日志 
\begin{DoxyParams}{参数}
{\em content} & \\
\hline
{\em level} & \\
\hline
{\em out} & \\
\hline
{\em path} & \\
\hline
{\em location} & \\
\hline
\end{DoxyParams}
\Hypertarget{class_logger_a69c0de1dd60ca195eb000a8fa94139a8}\index{Logger@{Logger}!threadExec@{threadExec}}
\index{threadExec@{threadExec}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{threadExec()}{threadExec()}}
{\footnotesize\ttfamily \label{class_logger_a69c0de1dd60ca195eb000a8fa94139a8} 
void Logger\+::thread\+Exec (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



\doxysubsection{类成员变量说明}
\Hypertarget{class_logger_a710380268f6d4bb1bfa841e0d71b3868}\index{Logger@{Logger}!mIsRunning@{mIsRunning}}
\index{mIsRunning@{mIsRunning}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{mIsRunning}{mIsRunning}}
{\footnotesize\ttfamily \label{class_logger_a710380268f6d4bb1bfa841e0d71b3868} 
bool Logger\+::m\+Is\+Running \{false\}\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_a4b3566ea069cfd43703b194ce9846d5e}\index{Logger@{Logger}!mLogs@{mLogs}}
\index{mLogs@{mLogs}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{mLogs}{mLogs}}
{\footnotesize\ttfamily \label{class_logger_a4b3566ea069cfd43703b194ce9846d5e} 
std\+::deque$<$\mbox{\hyperlink{class_log}{Log}}$>$ Logger\+::m\+Logs\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_a89fd90aeb0d8a6f67511e22b64d14eb6}\index{Logger@{Logger}!mMutex@{mMutex}}
\index{mMutex@{mMutex}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{mMutex}{mMutex}}
{\footnotesize\ttfamily \label{class_logger_a89fd90aeb0d8a6f67511e22b64d14eb6} 
std\+::mutex Logger\+::m\+Mutex\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_a9d7b008ee613498e7d2c6a320962555a}\index{Logger@{Logger}!thread@{thread}}
\index{thread@{thread}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{thread}{thread}}
{\footnotesize\ttfamily \label{class_logger_a9d7b008ee613498e7d2c6a320962555a} 
std\+::thread Logger\+::thread\hspace{0.3cm}{\ttfamily [private]}}

\Hypertarget{class_logger_ac8ffdc12d6b2ded2029b8de314b2ba12}\index{Logger@{Logger}!writeBehavior@{writeBehavior}}
\index{writeBehavior@{writeBehavior}!Logger@{Logger}}
\doxysubsubsection{\texorpdfstring{writeBehavior}{writeBehavior}}
{\footnotesize\ttfamily \label{class_logger_ac8ffdc12d6b2ded2029b8de314b2ba12} 
std\+::unique\+\_\+ptr$<$\mbox{\hyperlink{class_write}{Write}}$>$ Logger\+::write\+Behavior\hspace{0.3cm}{\ttfamily [private]}}



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
Log/\+Header/\mbox{\hyperlink{_logger_8h}{Logger.\+h}}\item 
Log/\+Source/\mbox{\hyperlink{_logger_8cpp}{Logger.\+cpp}}\end{DoxyCompactItemize}
